/*
package com.alibaba.citrus.cr.forecast.workflow;

import com.alibaba.citrus.cr.forecast.functions.model.DemoEntity;
import com.alibaba.cr.processorchestration.workflow.AbstractSessionScope;
import com.alibaba.cr.processorchestration.workflow.activity.AbstractWorkflowActivity;
import com.alibaba.fastjson.JSON;
import com.alibaba.lattice.annotation.ServiceEntrance;
import com.alibaba.lattice.annotation.WorkflowScenario;
import com.alibaba.lattice.model.constants.WorkFlowScenarioEnum;

import java.util.List;
import java.util.Map;

*/
/**
 * @description: L3流程节点服务
 * @author: qianlei
 * @create: 2021/09/01 17:28
 *//*

public class TradeWorkFlowService {
    @ServiceEntrance(code = "placeOrder", desc = "创单")
    @WorkflowScenario(type = WorkFlowScenarioEnum.START)
    public void placeOrder(List<DemoEntity> entities){
        TradeWorkFlowContext tradeWorkFlowContext = new TradeWorkFlowContext();
        List<DemoEntity> entityList = tradeWorkFlowContext.getWorkFlowPayloads();
        entityList.addAll(entities);
        try{
            new AbstractSessionScope<TradeWorkFlowContext>() {
                @Override
                protected TradeWorkFlowContext buildWorkFlowContext() {
                    return tradeWorkFlowContext;
                }

                @Override
                protected void updateStatus(TradeWorkFlowContext tradeWorkFlowContext, Map<String, String> map) {
                    tradeWorkFlowContext.getWorkFlowPayloads().forEach(o -> o.setStatus(1,2,3));
                }

                @Override
                protected void commitWorkFlowContext(TradeWorkFlowContext tradeWorkFlowContext) {
                    System.out.println(JSON.toJSONString(tradeWorkFlowContext.getWorkFlowPayloads()));
                    System.out.println("提交更新数据库");
                }
            }.process();
        }catch (Exception ex){
            ex.printStackTrace();
        }

    }
}
*/
